package chapter04;

public class Test03_throws {
    public static void main(String[] args) {
        int a = 20;
        int b = 0;
        try {
            System.out.println(divide(a,b));
        }catch (Exception e){
            System.out.println(e.getMessage());
        }
    }
    //throws抛出异常 调用函数的时候必须抓取异常 否则编译不能通过
    public static int divide(int a,int b) throws Exception{
        return a/b;
    }
}
